export default {
    namespaced: true,
    state: {
        num: 2,
    },
    getters: {
        doubleNum(state) {
            return state.num * 2;
        },
    },
    mutations: {
        plusNum(state, { n }) {
            state.num += n;
        },
    },
    actions: {
        plusNumWait({ commit }, payload) {
            setTimeout(() => {
                commit("plusNum", payload);
            }, 2000);
        },
    },
};
